package org.example.socket网络编程;

import java.net.InetAddress;
import java.net.UnknownHostException;

//TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。
public class Main {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress byName1 = InetAddress.getByName("127.0.0.1");
        System.out.println(byName1);
        InetAddress byName2 = InetAddress.getByName("www.baidu.com");
        System.out.println(byName2);
        InetAddress byName3= InetAddress.getLocalHost();
        System.out.println();
    }
}